package com.hnzq.cloud;


import com.hnzq.cloud.dto.AddShopcarGoodsDto;
import com.hnzq.cloud.dto.PageShopcarGoodsDto;
import com.hnzq.cloud.dto.UpdateGoodsCountDto;
import com.hnzq.cloud.model.Result;
import com.hnzq.cloud.param.AddShopcarGoodsParam;
import com.hnzq.cloud.param.UpdateGoodsCountParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


@FeignClient(value = "fresh-order-assembly",contextId = "ShopcarAPI",path = "freShopcar")
public interface ShopcarAPI {

    /**
     * 向购物车里添加商品信息
     * @param addShopcarGoodsParam
     * @return
     */
    @PostMapping("addShopcarGoods")
    public Result<AddShopcarGoodsDto> addShopcarGoods(@RequestBody AddShopcarGoodsParam addShopcarGoodsParam);


    /**
     * 查询当前用户的购物车列表
     * @return
     */
    @GetMapping("findShopcarGoods")
    public Result<PageShopcarGoodsDto> findShopcarGoods();


    /**
     * 操作购物车，修改商品数量
     * @param updateGoodsCountParam
     * @return
     */
    @PutMapping("updateGoodsCount")
    public Result<UpdateGoodsCountDto> updateGoodsCount(@RequestBody UpdateGoodsCountParam updateGoodsCountParam);

    /**
     * 操作购物车，删除商品
     * @param goodsId
     * @return
     */
    @DeleteMapping("removeGoods")
    public Result<Boolean> removeGoods(@RequestParam("goodsId") Integer goodsId);

}
